package com.motu.monstercity.module.common.redis;


import com.motu.vertx.module.utility.base.BaseRedisKey;

public class RedisKey extends BaseRedisKey {

	/**
	 * 获取用户延迟入库列表key
	 */
	public static String getUserUpdateDbListKey(long userId){
		return "list.updatedb.user." + userId;
	}

	public static String getAccountToken(int accountType,String account) {

		String key = "account_token."+accountType+"_"+account.toLowerCase();//账号转成小写

		return key;
	}

	/**
	 * 账号实名认证的key
	 * @param platformName 比如changmeng
	 * @param account
	 * @return
	 */
	public static String getCertificate(String platformName, String account) {
		String key = "certificate." + platformName + "." + account.toLowerCase();//账号转成小写
		return key;
	}

	public static String getUserInfoKey(long userId) {
		return getUserInfoKey(String.valueOf(userId));
	}

	public static String getUserInfoKey(String userId) {
		return "UserInfo." + userId;
	}

	public static String getUserExtInfoKey(long userId) {
		return "UserExtInfo." + userId;
	}

	public static String getNoticeListKey() {
		return "noticeList";
	}

	public static String getAccountMotuBindKey(String accountId) {
		return "MotuBind." + accountId;
	}
	public static String getRecommendKey(String accountId) {
		return "Recommend." + accountId;
	}

	public static String getRegressionKey(String accountId) {
		return "Regression." + accountId;
	}

	/***
	 * 获取更新数据库key
	 */
	public static String getUserTeamUpdateKey(long userId) {
		return "TeamUpdate." + userId;
	}

	/***
	 * 获取更新数据库key
	 */
	public static final String getUpdateDbKey(){
		return "vdb.list";
	}
	/***
	 * 获取表自增值的hash key
	 * @return
	 */
	public static final String getTableidKey(){
		return "tableid";
	}

	/***
	 * 用户世界聊天的缓存列表
	 */
	public static final String getChatRecordKey(long userId){
		return "list.userPublicRecord."+userId;
	}
	/***
	 * 获取玩家所在的网关服名字（离线会马上移除）
	 * @param userId
	 * @return
	 */
	public static final String getUserGateKey(long userId){
		return "gatename.user."+userId;
	}

	/***
	 * 用户登录设备信息（离线不删除，保留一段时间）
	 * @param userId
	 * @return
	 */
	public static final String getUserLoginDeviceKey(long userId){
		return "userlogindevice."+userId;
	}

	public static final String getServerOnlineKey(long serverId) {
		return "serveronline."+serverId;
	}

	/**
	 * 所有玩家在线数量key
	 */
	public static final String getUserOnlineKey() {
		return "useronline";
	}

	/**
	 * 网关上次更新在线数据时间
	 */
	public static String getMonitorPlayerOnlineUpdateTimeKey() {
		return "monitor.player.online.update.time";
	}

	/**
	 * 网关更新的在线数据
	 */
	public static String getMonitorPlayerOnlineKey(long timeStamp) {
		return "monitor.player.online." + timeStamp;
	}

	/***
	 * 获取该mobid最后登录的角色id
	 * @param mobId
	 * @return
	 */
	public static final String getMobidKey(String mobId) {
		return "mobid."+mobId;
	}

	/**
	 * 评价系统
	 */
	public static final String getAppraiseKey(int cardId) {
		return "lock.appraise." + cardId;
	}

	/**
	 * 用户红点数据
	 */
	public static final String getRedPoint(long userId) {
		return "lock.redPoint." + userId;
	}

	/**
	 * 获取注册设备关联数据唯一key
	 * @param deviceid
	 * @return
	 */
	public static final String getRegisterDeviceidKey(String deviceid) {
		return "register.deviceid." + deviceid;
	}

	/**
	 * 创建公会试炼数据
	 */
	public static final String getFamilyHuntInfoCreate(long familyId) {
		return "lock.familyHuntInfoCreate." + familyId;
	}

	/**
	 * 获取参加过主题活动的玩家列表
	 */
	public static final String getActMotifKey(long actId) {
		return "act.motif." + actId;
	}

	/**
	 * 获取竞猜过巅峰对决的玩家列表key
	 */
	public static final String getThroneBattleGuessListKey(int serverGroup, int round) {
		return "throne.battle.guess." + serverGroup + "." + round;
	}

	/**
	 * 获取巅峰对决有竞猜币的玩家列表key
	 */
	public static final String getThroneBattleGuessPriceListKey(int serverGroup) {
		return "throne.battle.guess." + serverGroup;
	}

	/**
	 * 获取巅峰对决有竞猜币的玩家列表key
	 */
	public static final String getThroneBattleGuessPriceSetKey(int serverGroup) {
		return "throne.battle.guess.set." + serverGroup;
	}

	/**
	 * 获取巅峰对决同战区服务器id列表key
	 */
	public static final String getThroneBattleServerIdListKey(int serverGroup) {
		return "throne.battle.server." + serverGroup;
	}

	/**
	 * 获取神海探险单服玩家列表key -- 改用排行榜筛选，废弃
	 * @param serverId
	 * @return
	 */
//	public static final String getOceanSagaVisitListKey(int serverId) {
//		return "ocean.saga.server." + serverId;
//	}

	/**
	 * 获取神海探险玩家数据更新redisKey
	 * @param userId
	 * @return
	 */
	public static final String getOceanSagaUpdateKey(long userId) {
		return "ocean.saga.update." + userId;
	}

	/**
	 * 获取家族争霸有竞猜币玩家列表key（活动结束竞猜币转化，新一届清理用）
	 */
	public static String getFamilyMatchGuessCoinUserListKey(int serverGroup) {
		return "family.match.guess.coin." + serverGroup;
	}

	/**
	 * 获取家族争霸参与竞猜玩家列表key（每个round竞猜结果结算用）
	 */
	public static String getFamilyMatchGuessRoundUserListKey(int serverGroup, byte round) {
		return "family.match.guess.round." + serverGroup + "." + round;
	}

	/**
	 * 获取家族Family对象key
	 */
	public static String getFamilyKey(long familyId) {
		return "Family." + familyId;
	}

	/**
	 * 获取武道会，淘汰赛，赛区竞猜玩家列表key（竞猜结算用）
	 */
	public static String getChampionKnockoutGuessListKey(long actId, int serverGroup, int zoneType) {
		return "champion.knockout.guess." + actId + "." + serverGroup + "." + zoneType;
	}

	/**
	 * 获取武道会，竞技赛 欢乐竞猜，竞猜玩家列表key（竞猜结算用）
	 */
	public static String getChampionArenaGuessListKey(long actId, int serverGroup, int round) {
		return "champion.arena.guess." + actId + "." + serverGroup + "." + round;
	}

	/**
	 * 获取武道会，竞技赛 欢乐竞猜，竞猜币总量（汇总竞猜币）
	 */
	public static String getChampionArenaGuessPriceKey(long actId, int serverGroup) {
		return "champion.arena.guess.price." + actId + "." + serverGroup;
	}

	/**
	 * 获取武道会，竞技赛 欢乐竞猜 当前轮次
	 */
	public static String getChampionArenaGuessRoundKey(long actId) {
		return "champion.arena.guess.round." + actId;
	}

	/**
	 * 获取武道会，海选赛，房间id生成用key
	 */
	public static String getChampionMatchRoomIdKey() {
		return "champion.match.room.id";
	}

	/**
	 * 获取武道会，海选赛，房间时间列表key（清理数据用）
	 * <p>set，每日开始时间戳
	 */
	public static String getChampionMatchTimeListKey(long actId) {
		return "champion.match.time." + actId;
	}

	/**
	 * 获取武道会，海选赛，房间列表key
	 * <p>hash，key房间id，value玩家id列表
	 */
	public static String getChampionMatchRoomListKey(long actId, int serverGroup, int zoneType,
													 int battleStageId, int dayStartTime) {
		return "champion.match.room." + actId + "." + serverGroup + "." + zoneType
				+ "." + battleStageId + "." + dayStartTime;
	}

	/**
	 * 获取武道会，海选赛，用户房间id列表key
	 * <p>hash，key房间id，value玩家id列表
	 */
	public static String getChampionMatchRoomUserListKey(long actId, int serverGroup, int zoneType,
														 int battleStageId, int dayStartTime) {
		return "champion.match.room.user." + actId + "." + serverGroup + "." + zoneType
				+ "." + battleStageId + "." + dayStartTime;
	}

	/**
	 * 武道会，海选房间位置占领key
	 */
	public static String getChampionMatchRoomPostionTakeKey(long actId, long roomId, int position) {
		return "champion.match.room.position.take." + actId + "." + roomId + "." + position;
	}

	/**
	 * 基金单服任务进度用的，可达成用户，数据记录
	 * <p>此数据目前只有更新显示假数据用
	 * <p>每个服一份，合服需处理此数据
	 * <p>数据结构为{"任务type和档位ID":"累计数","任务type和档位ID":"累计数"}
	 */
	public static String getFundServerTaskCanNumKey(int serverId) {
		return "fund.server.task.can.num." + serverId;
	}

	/**
	 * 获取用户主题活动子活动结束记录数据原子锁
	 */
	public static final String getUserMotifSubEndRecordKey(long userId, long actId, int subActId) {
		return "lock.userMotifSubEndRecord." + userId + "." + actId + "." + subActId;
	}

	/**
	 * 获取用户主题活动子活动结算记录数据原子锁
	 */
	public static final String getUserMotifSubCloseRecordKey(long userId, long actId, int subActId) {
		return "lock.userMotifSubCloseRecord." + userId + "." + actId + "." + subActId;
	}

	/**
	 * 获取服务器武神殿机器人数据原子锁
	 */
	public static final String getServerAresTempleRobotKey(int serverId) {
		return "lock.serverAresTempleRobo." + serverId;
	}

	/**
	 * 获取武神殿武神领域机器人数据原子锁
	 */
	public static final String getAresTempleGroupRobotKey(int serverGroup) {
		return "lock.aresTempleGroupRobot." + serverGroup;
	}

	/**
	 * 获取武神殿武神领域追随者原子锁
	 */
	public static final String getAresTempleGroupFollowKey(long followId) {
		return "lock.aresTempleGroupFollow." + followId;
	}

	/**
	 * 获取协议并发请求key
	 */
	public static String getProtocolRequestKey(){
		return "protocol.request";
	}

	/**
	 * 玩家初始化数据key
	 */
	public static final String getUserInitKey(long userId) {
		return "user.init." + userId;
	}

	public static final String getServerHonorKey(int serverId, long honorId) {
		return "serverhonor.init.s" + serverId + "." + honorId;
	}

	public static final String getUnionHonorKey(long unionId, long honorId) {
		return "unionhonor.init.u" + unionId + "." + honorId;
	}

	/**
	 * 获取ip创角限制key
	 */
	public static final String getRoleLimitKey(String ip) {
		return "role.limit." + ip;
	}

	/**
	 * 设备创角限制key
	 */
	public static final String getRoleDeviceLimitKey(String deviceId) {
		return "role2.limit." + deviceId;
	}

	/**
	 * 获取主题活动用户派发红包key -- 节日
	 */
	public static final String getUserMotifRedPacketKey(long userId, long actId, int subActId){
		return "motif.user.red.packet." + userId + "." + actId + "." + subActId;
	}

	/**
	 * 获取主题活动用户派发红包key -- 王中王
	 */
	public static final String getUserMotifRedPacketBetKey(long userId, long actId, int subActId){
		return "motif.user.red.packet.bet." + userId + "." + actId + "." + subActId;
	}

	/**
	 * 获取主题活动用户派发红包key -- 礼盒
	 */
	public static final String getUserMotifRedPacketGiftKey(long userId, long actId, int subActId){
		return "motif.user.red.packet.gift." + userId + "." + actId + "." + subActId;
	}

	/**
	 * 获取主题活动已删除红包key
	 */
	public static final String getMotifRedPacketDeleteKey(long redPacketId){
		return "motif.red.packet.delete." + redPacketId;
	}

	/**
 	 */
	public static final String getMotifSelfActKey(long userId, int day, int type){
		return "motif.self.act." + userId + "." + day + "." + type;
	}

	public static final String getUserMotifSelfActKey(long userId){
		return "UserMotifSelf." + userId;
	}

	/**
	 * 获取主题活动贸易大赛匹配池的唯一key
	 */
	public static final String getMotifActTradeMatchKey(long actId, int subActId) {
		return "motif.act.trade.match." + actId + "." + subActId;
	}

	/**
	 * 获取三消小游戏阵营数据原子锁
	 */
	public static final String getMotifGameEliminateTeam(long actId, int subActId, int serverGroup) {
		return "motif.game.eliminate.team." + actId + "." + subActId + "." + serverGroup;
	}

	/**
	 * 获取参加三消小游戏的阵营玩家列表
	 */
	public static final String getMotifGameEliminateUser(long actId, int subActId, int serverGroup, int round, int team) {
		return "motif.game.eliminate.team.user." + actId + "." + subActId + "." + serverGroup + "." + round + "." + team;
	}

	/**
	 * 获取主题活动翻牌数据原子锁
	 */
	public static final String getMotifFlipData(long actId, int subActId, int round) {
		return "motif.flip.data." + actId + "." + subActId + "." + round;
	}

	/**
	 * 巅峰对决玩家竞猜列表切换原子锁
	 */
	public static final String getThroneBattleUserGuessList(int serverGroup) {
		return "throne.battle.user.guess.list" + serverGroup;
	}

	/**
	 * 获取绑定手机奖励领取状态
	 */
	public static final String getPhoneBindReward(String accountId) {
		return "lock.phone.bind.reward." + accountId;
	}

	/**
	 * 获取绑定手机角色奖励领取状态
	 */
	public static final String getPhoneBindUserReward(long userId) {
		return "lock.phone.bind.user.reward." + userId;
	}

	/**
	 * 获取主题活动琼楼盛宴匹配池的唯一key
	 */
	public static final String getMotifActBetOnlineMatchKey(long actId, int subActId) {
		return "motif.act.bet.online.match." + actId + "." + subActId;
	}

	/**
	 * 获取主题活动琼楼盛宴游戏场次的唯一key
	 */
	public static final String getMotifActBetOnlineGameIdKey(long actId, int subActId) {
		return "motif.act.bet.online.game." + actId + "." + subActId;
	}

	/**
	 * 获取主题活动琼楼盛宴结算的唯一key
	 */
	public static final String getMotifActBetOnlineResultKey(long actId, int subActId, long userId) {
		return "motif.act.bet.online.result." + actId + "." + subActId + "." + userId;
	}

	/**
	 * 舞会显示用列表key（大型舞会全服，小型活动服分组）
	 */
	public static String getPartyShowListKey(long actId, int subActId, int round, int showServerGroup) {
		return "party.show.list." + actId + "." + subActId + "." + round + "." + showServerGroup;
	}

	/**
	 * 舞会结算唯一key
	 */
	public static String getPartyInfoFinishKey(long partyId) {
		return "party.info.finish." + partyId;
	}

	/**
	 * 舞会抽奖结算唯一key
	 */
	public static String getPartyDrawFinishKey(long partyId) {
		return "party.draw.finish." + partyId;
	}

	/**
	 * 舞会，轮次结算唯一key
	 */
	public static String getPartyRoundFinishKey(long actId, int subActId, int round, int serverGroup) {
		return "party.round.finish." + actId + "." + subActId + "." + round + "." + serverGroup;
	}

	/**
	 * 获取节日活动雪人大战战区计算的唯一key
	 */
	public static final String getFestivalWarActGroupResultKey(long actId, int subActId, int actGroup) {
		return "festival.act.war.actgroup.result." + actId + "." + subActId + "." + actGroup;
	}

	/**
	 * 获取节日活动-埃蒙锦鲤-活动战区nx的唯一key
	 */
	public static String getFestivalLuckyNumNxKey(long actId, int subActId, int actGroup, int round) {
		return "festival.act.lucky.num.nx." + actId + "." + subActId + "." + actGroup + "." + round;
	}

	/**
	 * 获取节日活动-埃蒙锦鲤-活动战区号码池的唯一key
	 */
	public static String getFestivalLuckyNumberPoolKey(long actId, int subActId, int actGroup, int round) {
		return "festival.act.lucky.num.actgroup.pool." + actId + "." + subActId + "." + actGroup + "." + round;
	}

	/**
	 * 获取节日活动-埃蒙锦鲤-活动战区所有已发放号码的总权重计数key
	 */
	public static String getFestivalLuckyAllRateKey(long actId, int subActId, int actGroup, int round) {
		return "festival.act.lucky.all.rate." + actId + "." + subActId + "." + actGroup + "." + round;
	}

	/**
	 * 获取节日活动-埃蒙锦鲤-活动战区开奖结果的唯一key
	 */
	public static String getFestivalLuckyNumberRecordKey(long actId, int subActId, int actGroup, int round, int prizeLevel) {
		return "festival.act.lucky.num.actgroup.record.level." + actId + "." + subActId + "." + actGroup + "." + round + "." + prizeLevel;
	}

	/**
	 * 获取主题活动新服加速活动账号唯一key
	 */
	public static String getActMotifNewServerAccountKey(String accountId) {
		return "act.motif.new.server.account." + accountId;
	}

	/**
	 * 获取主题活动新服加速活动账号活跃玩家标记唯一key
	 */
	public static String getActMotifNewServerAccountActiveKey(String accountId) {
		return "act.motif.new.server.account.active." + accountId;
	}

	/**
	 * 侍魂副本玩家记录公会宝箱列表key
	 */
	public static String getGuardBossFamilyBoxKey(long userId) {
		return "guard.boss.family.box." + userId;
	}

	/**
	 * 用户系统主题活动原子锁
	 */
	public static String getUserSystemMotifActKey(long userId, long actId) {
		return "lock.userSystemMotifAct." + userId + "." + actId;
	}

	/**
	 * 试炼塔活动阶段一公会挑战次数计数Key
	 */
	public static String getTrialTowerStage1FamilyNumKey(long actId, long familyId) {
		return "trial.tower.stage1.family.num." + actId + "." + familyId;
	}

	/**
	 * 段位赛排行榜奖励分组记录key
	 */
	public static String getDanRankRewardGroupKey() {
		return "dan.rank.reward.group";
	}

	/**
	 * 巅峰对决排行榜奖励分组记录key
	 */
	public static String getThroneBattleRankRewardGroupKey() {
		return "throne.battle.rank.reward.group";
	}

	/**
	 * 试炼塔活动阶段一Boss生成Key
	 */
	public static String getTrialTowerStage1BossKey(long actId, long familyId) {
		return "trial.tower.stage1.boss." + actId + "." + familyId;
	}

	/**
	 * 试炼塔活动阶段二服务器数据生成key
	 */
	public static String getTrialTowerSecondServerKey(long actId, int serverId) {
		return "trial.tower.second.server." + actId + "." + serverId;
	}

	/**
	 * 用户试炼塔阶段二抽奖进度
	 */
	public static String getUserTrialTowerSecondDrawCurp(long actId, long userId) {
		return "user.trial.tower.second.draw.curp." + actId + "." + userId;
	}

	/**
	 * 节日活动累充送礼库存计数Key
	 */
	public static String getRechargeReturnNumKey(long actId, int subActId) {
		return "recharge.return.num." + actId + "." + subActId;
	}

	/**
	 * 赛季副本参与抽奖的玩家List key
	 */
	public static String getSeasonDungeonTurntableListKey(long actId) {
		return "season.dungeon.turntable.list." + actId;
	}

	/**
	 * 子嗣发布公共联姻列表List key
	 */
	public static String getChildMarrageListKey(int sex) {
		return "child.marrage.list." + sex;
	}

	/**
	 * 玩家查看的公共联姻列表缓存信息key(每个玩家根据性别两个列表)
	 */
	public static String getUserChildMarrageListKey(long userId, int sex) {
		return "user.child.marrage.list." + userId + sex;
	}

	/**
	 * 随机事件的同步key
	 */
	public static String getEventLockKey(long userId) {
		return "event.lock." + userId;
	}

	/**
	 * 冲榜排行榜key
	 */
	public static String getCrossRankActKey(int groupId, long rankId) {
		return "cross.rank.act." + groupId + "." + rankId;
	}

	/**
	 * 跨服冲榜 分组数据
	 * @param rankid 榜单id
	 * @param rankactTime 榜单开始时间
	 * @return
	 */
	public static final String getCrossRankactServerGroup(int rankid,String rankactTime) {
		return "cross.rankact.group.info." + rankid + "."+ rankactTime;
	}

	/**
	 * 获取跨服冲榜活动全服排名情况 -- 作用于下一次同榜单分组依据
	 * @return
	 */
	public static final String getCrossRankActLastServerRank(int rankid) {
		return "crossrankact.last.server.rank" + rankid;
	}

	/**
	 * 获取联盟限时充值活动记录的key
	 * @param unionId 联盟id
	 * @param dayStr 活动开始时间
	 * @return
	 */
	public static final String getUnionActChargeRecordKey(long unionId,String dayStr) {
		return "union.act.charge." + unionId+"."+dayStr;
	}

	/**
	 * 获取联盟折扣商店活动记录的key
	 * @param unionId 联盟id
	 * @param dayStr 活动开始时间
	 * @return
	 */
	public static final String getUnionDiscountShopRecordKey(long unionId,String dayStr) {
		return "union.discountshop." + unionId+"."+dayStr;
	}


}
